﻿<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>TODO</title>
    <link rel="stylesheet" href="./TODO.css">
    <script src="jquery.min.js"></script>

    <script src="../node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
    <link href="../node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />
    <script>
        function test() {
            $("#myModal").modal("show")
        }
    </script>
</head>

<body>
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModal-label">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModal-label">Modal title</h4>
                </div>
                <div class="modal-body">
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary">Save</button>
                </div>
            </div>
        </div>
    </div>
    <div id="todo">
        <input type="button" value="test" onclick="test()" />
        <h2>剩余待办：{{todoTotal}}条</h2>
        <div>
            <div class="todo-input">
                <input type="text" v-model.trim="todoNew">
                <button @click="todoAdd">添加</button>
            </div>
        </div>
        <div class="todo-input">
            <input type="text" v-model.trim="searchText" @keyup.enter="search(searchText)" placeholder="回车查找">
            <button @click="search(searchText)">查找</button>
        </div>
        <ul>
            <li v-for="(todo,index) in todoList" :key="index">
                <input v-model='todo.Checked' type="checkbox">
                <input v-model='todo.Text' type="text" v-if="todo.Editable">
                <label v-else :class="{completed:todo.Checked}">{{todo.Text|toUpper}}</label>
                <button @click='editTodo(todo)' v-if="!todo.Editable">编辑</button>
                <button v-else @click='saveTodo(todo)'>保存</button>
                <button :disabled='todo.Editable' @click='todoRemove(todo)'>删除</button>
            </li>
        </ul>
    </div>
    <script src="./vue.js"></script>
    <script src="./TODO2.js"></script>
</body>

</html>
